home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-01-13 | 3.4 KB | 142 lines | [TEXT/PJMM] |
- {****************************************************}
- {}
- { CStarterPane.p }
- {}
- { Pane methods for a typical application. }
- {}
- { Copyright © 1989, Symantec Corporation. All rights reserved. }
- {}
- {****************************************************}
-
-
- {***}
- { *}
- { * Most applications will want a scrollable window, so this}
- { * class is based on the class CPanorama. All the methods here}
- { * would still apply to classes based directly on CPane.}
- { *}
- { ***}
-
-
- UNIT CStarterPane;
-
- INTERFACE
-
- USES
- TCL, CSFDialogs, StarterIntf;
-
- IMPLEMENTATION
-
-
- {**}
- { * IStarterPane}
- { *}
- { * Initialize a StarterPane object.}
- { *}
- { **}
-
- PROCEDURE CStarterPane.IStarterPane (anEnclosure: CView; aSupervisor: CBureaucrat; aWidth, aHeight, aHEncl, aVEncl: integer; aHSizing, aVSizing: SizingOption);
- BEGIN
- IPanorama(anEnclosure, aSupervisor, aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing);
- END;
-
-
- {**}
- { * Draw}
- { *}
- { * In this method, you draw whatever you need to display in}
- { * your pane. The area parameter gives the portion of the }
- { * pane that needs to be redrawn. Area is in frame coordinates.}
- { *}
- { **}
-
- PROCEDURE CStarterPane.Draw (VAR area: Rect);
-
- BEGIN
- { draw your stuff }
- END;
-
-
- {**}
- { * DoClick}
- { *}
- { * The mouse went down in the pane.}
- { * In this method you do whatever is appropriate for your}
- { * application. HitPt is given in frame coordinates. The other}
- { * parameters, modiferKeys and when, are taken from the event}
- { * record.}
- { *}
- { * If you want to implement mouse tracking, this is the method}
- { * to do it in. You need to create a subclass of CMouseTask and}
- { * pass it in a TrackMouse message to the pane.}
- { *}
- { **}
-
- PROCEDURE CStarterPane.DoClick (hitPt: Point; modifierKeys: integer; when: longint);
-
- BEGIN
- { what happens when the mouse goes down }
- END;
-
-
- {**}
- { * HitSamePart}
- { *}
- { * Test whether pointA and pointB are in the same part.}
- { * "The same part" means different things for different applications.}
- { * In the inherited method, "the same part" means "in the same pane."}
- { * If you want a different behavior, override this method. For instance,}
- { * two points might be in the same part if they're within n pixels}
- { * of each other.}
- { *}
- { * PointA and pointB are both in frame coordinates.}
- { *}
- { **}
-
- FUNCTION CStarterPane.HitSamePart (VAR pointA, pointB: Point): Boolean;
-
- BEGIN
- HitSamePart := INHERITED HitSamePart(pointA, pointB);
- END;
-
-
- {**}
- { * AdjustCursor}
- { *}
- { * If you want the cursor to have a different shape in your pane,}
- { * do it in this method. If you want a different cursor for different}
- { * parts of the same pane, you'll need to change the mouseRgn like this:}
- { * 1. Create a region for the "special area" of your pane.}
- { * 2. Convert this region to global coordinates}
- { * 3. Set the mouseRgn to the intersection of this region}
- { * and the original mouseRgn: SectRgn(mouseRgn, myRgn, mouseRgn);}
- { *}
- { * The inherited method just sets the cursor to the arrow. If this is fine}
- { * for you, don't override this method.}
- { *}
- { **}
-
- PROCEDURE CStarterPane.AdjustCursor (where: Point; mouseRgn: RgnHandle);
-
- BEGIN
- INHERITED AdjustCursor(where, mouseRgn);
- END;
-
-
- {**}
- { * ScrollToSelection}
- { *}
- { * If your pane is based on a Panorama (as this example is), you might}
- { * want to define what it means to have a selection and what it means to}
- { * scroll to that selection.}
- { *}
- { **}
-
- PROCEDURE CStarterPane.ScrollToSelection;
-
- BEGIN
- { scroll to the selection }
- END;
-
-
- END.